Page({
	data: {
		isLegalUrl: true,
		hrefLink: ""
	},
	onLoad(params) {
		var hrefLink = params.hrefLink;
		var regex = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
		if (regex.test(hrefLink)) {
			this.setData({
				"hrefLink": hrefLink,
				"isLegalUrl": true
			});
		} else {
			this.setData({
				"isLegalUrl": false
			});
			dd.alert({ title: "跳转地址不合法,请检查后台地址设置是否正确" });
		}
	},
});
